home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / pump_src / cretab.c < prev    next >
C/C++ Source or Header  |  1996-04-24  |  1KB  |  30 lines

  1. #include <math.h>
  2.  
  3. /*
  4.  
  5. This file is actually very special. It is the one used to generate the
  6. 'tabla.h' to drive one of the picture shows in the demo. The special thing
  7. in it uses the hyperbolic sine and cosine functions, which are not a too
  8. usual thing in the demoscene. I (Yann) remember when Jare, after around
  9. 15 continuous hours leaning on the keyboards, it was something like 7 AM,
  10. looked over to my screen, and said something like 'Hyperbolic functions?',
  11. with a voice I will never forget. I had to finish the thing fast so that
  12. he would calm down from thinking that, after all, we were going to use
  13. the functions from math.h in the library. He recovered quite well when
  14. he saw this doomed code wouldn't be linked into the runtime.
  15.  
  16. */
  17.  
  18. #define NSECS 2
  19.  
  20. main() {
  21.     double i;
  22.     double val;
  23.  
  24.     for (i = 0; i < 70*NSECS; i++) {
  25.         val = (i-35*NSECS)/(10*NSECS);
  26.         val = - sinh(val) / cosh(val);
  27.         printf("%d,\n", 160+(int)(160.0*val));
  28.     }
  29. }
  30.